package com.qrcode.service.impl.hello;


import com.github.pagehelper.PageInfo;
import com.qrcode.beans.user.User;
import com.qrcode.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: yzx96
 * @CreateTime: 2019-09-29 21:46
 * @Description: ${Description}
 */
@RestController
public class HelloController {
    /**
     * 注入用户服务类
     */
    @Autowired
    private IUserService userService;
    @RequestMapping("/")
    public String hello(){
        return "service is start";
    }

    @RequestMapping("/userInfo")
    public List<User> userInfo(@RequestParam("page") int page, @RequestParam("limit") int limit){
        PageInfo pageInfo = userService.getUsersLimit(page,limit);
        return pageInfo.getList();
    }
}
